package com.inno.log.controller;

import cn.hutool.core.lang.Assert;
import com.inno.log.entity.CommonReturnType;
import com.inno.log.entity.OperationLog;
import com.inno.log.entity.OperationLogVO;
import com.inno.log.entity.PageResult;
import com.inno.log.service.OperationLogService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shenzeyang
 */
@RestController
@RequestMapping("/log")
public class LogController {
    @Resource
    private OperationLogService operationLogService;

    @PostMapping("/queryPage")
    public CommonReturnType<PageResult<OperationLogVO>> queryPage(@RequestBody OperationLog operationLog){
        Assert.notNull(operationLog.getPage(),"分页参数不能为空");
        Assert.notNull(operationLog.getPageSize(),"分页参数不能为空");
        return CommonReturnType.success(operationLogService.queryPage(operationLog));
    }
}
